﻿using System;
using System.Windows.Forms;

namespace ProjectStudent
{
    public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
        }

        private void btnRegister_Click(object sender, EventArgs e)
        {
            this.Hide();
            UserRegister register = new UserRegister();
            register.ShowDialog();
            this.Show();
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            //string username = txtName.Text;
            //string password = txtPassword.Text;

            //UserDao userDao = new UserDao();
            //User user = userDao.CheckLogin(username, password);
            //if (user != null)
            //{
            //    this.Hide();
            //    FormMain formMain = new FormMain();
            //    formMain.ShowDialog();
            //    this.Show(); // FormMain 关闭后，返回登录界面
            //}
            //else
            //{
            //    MessageBox.Show("用户名或密码错误！");
            //}
        }
    }
}
